package com.qf.dto;

import com.qf.pojo.CheckNull;
import org.springframework.util.StringUtils;


public class UserDto implements CheckNull {

    private Long userid;
    private String username;
    private String password;
    private String repeatpassword;
    private String passwordsalt="1314";


    @Override
    public boolean isNull() {
        if(userid == null){
            return StringUtils.isEmpty(username) || StringUtils.isEmpty(password);
        }else{
            return StringUtils.isEmpty(username) && StringUtils.isEmpty(password)&&StringUtils.isEmpty(repeatpassword);
        }
    }

    @Override
    public String toString() {
        return "UserDto{" +
                "userid=" + userid +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", repeatpassword='" + repeatpassword + '\'' +
                ", passwordsalt='" + passwordsalt + '\'' +
                '}';
    }

    public Long getUserid() {
        return userid;
    }

    public void setUserid(Long userid) {
        this.userid = userid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRepeatpassword() {
        return repeatpassword;
    }

    public void setRepeatpassword(String repeatpassword) {
        this.repeatpassword = repeatpassword;
    }

    public String getPasswordsalt() {
        return passwordsalt;
    }

    public void setPasswordsalt(String passwordsalt) {
        this.passwordsalt = passwordsalt;
    }
}
